package cn.edu.qlnu.xky.test.service;

import java.util.ArrayList;
import java.util.List;

import cn.edu.qlnu.xky.test.common.Page;
import cn.edu.qlnu.xky.test.dao.StudentDao;
import cn.edu.qlnu.xky.test.model.Student;

/**
 * 接收servlet传递来的参数，进行加工处理
 * 调用dao的方法获得结果
 * 不能出现sql语句
 */
public class StudentService {
	
	private StudentDao dao = null;
	
	public StudentService() {
		dao = new StudentDao();
	}

	public int addStudent(Student stu) {
		return dao.addStudent(stu);
	}
	
	public int editStudent(Student stu) {
		return dao.edtiStudent(stu);
	}
	public int deleteStudent(int id) {
		return dao.deleteStudent(id);
	}
	
	public Student searchById(int id) {
		return dao.searchById(id);
	}
	
	public Page<Student> searchByNamePage(String name,int pageNo){
		return dao.searchByNamePage(name, pageNo);
	}
	
	public List<Student> searchByName(String name){
		
		return dao.searchByName(name);
	}
	
	
}
